<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<script src="./lib/template-web.js"></script>
	<script src="./lib/jquery.js"></script>
</head>

<body>
	<div class="box"></div>

	<ul>

	</ul>

	<!-- 	<li>这是第{{$value.id}}个li===name:{{$value.name}}====索引：{{$index}}</li> -->

	<script type="text/html" id='tpl'>
		==={{time}}
		{{each arr  item i}}
		<li>这是第{{item.id}}个li===name:{{item.name}}====索引：{{i}}</li>
		{{/each}}
	</script>

	<script>
		var obj = {
			time: new Date(),
			arr: [{
					id: 1,
					name: 'jack'
				},
				{
					id: 2,
					name: 'jack2'
				},
				{
					id: 3,
					name: 'jack3'
				},
				{
					id: 4,
					name: 'jack4'
				},
			]
		}


		var html = template('tpl', obj)
		// var html = template('tpl', {
		// 	arr2: obj.arr
		// })
		$('ul').html(html)
	</script>

</body>

</html>
